package com.example.chasshelper.utils;

import com.example.chasshelper.dao.ClassroomDao;
import com.example.chasshelper.dao.CourseDao;
import com.example.chasshelper.dao.MessageDao;
import com.example.chasshelper.dao.RegistrationDao;
import com.example.chasshelper.dao.SolutionDao;
import com.example.chasshelper.dao.StudentDao;
import com.example.chasshelper.dao.TeacherDao;
import com.example.chasshelper.dao.TestDao;
import com.example.chasshelper.model.Message;

import okhttp3.OkHttpClient;

public class DaoUtils {
    private static ClassroomDao classroomDao;
    private static CourseDao courseDao;
    private static MessageDao messageDao;
    private static RegistrationDao registrationDao;
    private static StudentDao studentDao;
    private static TeacherDao teacherDao;
    private static TestDao testDao;
    private static SolutionDao solutionDao;
    public static ClassroomDao getClassroomDao() {
        if (classroomDao == null) {
            classroomDao = new ClassroomDao();
        }
        return classroomDao;
    }

    public static CourseDao getCourseDao() {
        if (courseDao == null) {
            courseDao = new CourseDao();
        }
        return courseDao;
    }

    public static MessageDao getMessageDao() {
        if (messageDao == null) {
            messageDao = new MessageDao();
        }
        return messageDao;
    }

    public static RegistrationDao getRegistrationDao() {
        if (registrationDao == null) {
            registrationDao = new RegistrationDao();
        }
        return registrationDao;
    }

    public static StudentDao getStudentDao() {
        if (studentDao == null) {
            studentDao = new StudentDao();
        }
        return studentDao;
    }

    public static TeacherDao getTeacherDao() {
        if (teacherDao == null) {
            teacherDao = new TeacherDao();
        }
        return teacherDao;
    }

    public static TestDao getTestDao() {
        if (testDao == null) {
            testDao = new TestDao();
        }
        return testDao;
    }

    public static SolutionDao getSolutionDao() {
        if (solutionDao == null) {
            solutionDao = new SolutionDao();
        }
        return solutionDao;
    }
}
